﻿$(document).ready(function () {

    $("#list").jqGrid({
        height: 300,
        width: 1200,
        url: '/Node/GetNodesData/',
        datatype: 'json',
        mtype: 'POST',
        colNames: ['Id', 'Name', 'Identifiers', 'Licenses'],
        colModel: [
          { name: 'Id', index: 'Id', width: 275, sortable: false },
          { name: 'Name', index: 'Name', width: 225, sortable: false, editable: true, editrules: { required: true } } ,                  
          { name: 'Identifiers', index: 'Identifiers', width: 400, sortable: false, editable: true, edittype: 'textarea', editrules: { required: true }, editoptions: {rows:"6",cols:"37"} } ,                  
          { name: 'Licenses', index: 'Licenses', width: 300, sortable: false }
          ],
        pager: jQuery('#pager'),
        rowNum: 10,
        rowList: [10, 50],
        sortname: 'name',
        sortorder: "asc",
        viewrecords: true,
        imgpath: '/Content/images',
        caption: 'Nodes',
    }).navGrid('#pager', { edit: false, add: true, del: false, search: false }, {}, { addCaption: 'Add a node', url: '/Node/New/', closeAfterAdd: true, reloadAfterSubmit: true, afterSubmit: jqgridHelpers.after_submit });
}); 